package com.sqxgg.drugstore.threadPool.service;

import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.AsyncResult;
import org.springframework.stereotype.Service;
import org.springframework.util.concurrent.ListenableFuture;
@Service
public class TestThread {
    @Async("TaskExecutor")
    public ListenableFuture<String> sayHello(String name) throws InterruptedException {
        String res = name + ":Hello World!";
        Thread.sleep(1200000);
        System.out.println(res);
        return new AsyncResult<>(res);
    }
}
